package com.jhhc.RHDB.Data.Pojo;


import lombok.Data;

import java.util.ArrayList;
import java.util.List;

//实时数据

public class Stations {

    // 站码
    private String stcd;

    //站名
    private String stnm;

    // 数据类型
    private StepLength steplength;

    // 传感器数据
    private List<Sensors> Sensors;


    public Sensors getSensor(String sensor_T) {
        //Sensors sensors=null;
           // System.out.println(Sensors.toString());
        System.out.println(Sensors);
        System.out.println(sensor_T+"11");
        if (Sensors != null) {
            for (Sensors sensor : Sensors) {
                if (sensor.getSensorType().toString().equals(sensor_T)) {
                    return sensor;
                }
            }
        }

        return null;


    }

    //get  //set
    public String getSTCD() {
        return stcd;
    }


    public void setSTCD(String stcd) {
        this.stcd = stcd;
    }


    public StepLength getSteplength() {
        return steplength;
    }

    public void setSteplength(StepLength steplength) {
        this.steplength = steplength;
    }

    public String getStnm() {
        return stnm;
    }


    public void setStnm(String stnm) {
        this.stnm = stnm;
    }


    public List<Sensors> getSensors() {
        return Sensors;
    }


    List<Sensors> sensorsL = new ArrayList<Sensors>();

    public void setSensors(Sensors sensors) {
        Sensors = sensorsL;
        sensorsL.add(sensors);
    }

//	public void setSensors(List<Sensors> sensors) {
//		Sensors = sensors;
//

    @Override
    public String toString() {
        return "Stations{" +
                "stcd='" + stcd + '\'' +
                ", stnm='" + stnm + '\'' +
                ", steplength=" + steplength +
                ", Sensors=" + Sensors +
                '}';
    }
//	}


}

